import type { AddressListType } from "@/types/address";
import { defineStore } from "pinia";
import { ref } from "vue";

// 存放收货地址信息仓库
export const useAddressStore = defineStore('address', () => {
    // 保存地址信息
    const seleteAddress = ref<AddressListType>()
    // 更改时使用
    const changeSeleteAddress = (val: AddressListType) => {
        seleteAddress.value = val
    }
    // 清理时使用
    const clearSeleteAddress = () => {
        seleteAddress.value = undefined
    }
    return {
        seleteAddress,
        changeSeleteAddress,
        clearSeleteAddress
    }
})